/**
 * <p>Copyright (c) 2017 深圳市鹏途交通科技有限公司 </p>
 * <p>				   All right reserved. 		     </p>
 * 
 * <p>项目名称 ： 	         </p>
 * <p>创建者   :	lei 
 * 
 * <p>描   述  :   OperationController.java for com.pengtu.gsj.controller.system    </p>
 * 
 * <p>最后修改 : $: 2017年4月19日-下午5:57:24 v 1.0.0	 lei   $ </p>
 * 
*/

package com.pengtu.gsj.controller.system;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pengtu.gsj.controller.base.BaseController;
import com.pengtu.gsj.dao.base.QueryFilter;
import com.pengtu.gsj.dao.base.QueryFilter.MatchType;
import com.pengtu.gsj.security.SpringSecurityUtils;
import com.pengtu.gsj.service.system.LogService;
import com.pengtu.gsj.utils.web.SpringMvcUtils;

/**
 * 
 * OperationController
 * 
 * 2017年4月19日 下午5:57:24
 * 
 * @version 1.0.0
 * 
 */
@Controller
@RequestMapping("operation")
public class OperationController extends BaseController {
	@Autowired
	private LogService logService;
	
	@RequestMapping("show")
	public String showOPeration(Model model){
		model.addAttribute("top", SpringMvcUtils.getParameter("top"));
		model.addAttribute("left", SpringMvcUtils.getParameter("left"));
		return "system/operation_note";
	}
	/**
	 *描述:ajax获取操作信息
	 *作者:lipengkun
	 *日期:2017年6月26日
	 */
	@RequestMapping(value="listInfo", produces = "application/json; charset=utf-8")
	@ResponseBody
	public Map<String,List<Map<String, String>>> getRoadRepairList( HttpServletRequest request){
		QueryFilter queryFilter = QueryFilter.buildFromHttpRequest(request);
		//获取当前用户名
		String name = SpringSecurityUtils.getCurrentName();
		queryFilter.addFilter("username", name, MatchType.EQ);
		Map<String,List<Map<String, String>>> yearMap = logService.getYearMap(logService.getLogs(queryFilter));
		return yearMap;
	}
}
